package com.example.supernote.data.repository

import com.example.supernote.data.entity.FileEntity
import com.example.supernote.data.entity.TrashEntity
import kotlinx.coroutines.flow.Flow

/**
 * Repository that provides insert, update, delete, and retrieve of [Item] from a given data source.
 */
interface FileEntityRepository {
    /**
     * Retrieve all the items from the the given data source.
     */
    fun getAllFileEntitiesStream(): Flow<List<FileEntity>>

    /**
     * Retrieve an item from the given data source that matches with the [id].
     */
    suspend fun getFileEntityStream(id: Int): FileEntity

    /**
     * Insert item in the data source
     */
    suspend fun insertFileEntity(fileEntity: FileEntity)

    /**
     * Delete item from the data source
     */
    suspend fun deleteFileEntityById(id: Int)

    /**
     * Update item in the data source
     */
    suspend fun updateFileEntity(fileEntity: FileEntity)

    /**
    * -------------------Trash-------------------
    * */

    /**
     * Retrieve all the items from the the given Trash.
     */
    fun getAllTrashEntitiesStream(): Flow<List<TrashEntity>>

    /**
     * Retrieve an item from the given Trash that matches with the [id].
     */
    suspend fun getTrashEntityStream(id: Int): TrashEntity?

    /**
     * Insert item in the Trash
     */
    suspend fun insertTrashEntity(trashEntity: TrashEntity)

    /**
     * Delete item from the Trash
     */
    suspend fun deleteTrashEntityById(id: Int)
}